<script>
var url = '/todos';
var headers = {
    "Content-Type": "application/x-www-form-urlencoded"
}
fetch(url, {
    method: 'POST',
    body: "title=学习fetch",
    headers: headers
}).then(res => res.json())
.catch(error => console.error('Error:', error)).then(response => console.log('Success:', response));
</script>